/*
 * @ : Copyright (c) 2021 Phytium Information Technology, Inc. 
 *  
 * SPDX-License-Identifier: Apache-2.0.
 * 
 * @Date: 2021-07-14 09:47:37
 * @LastEditTime: 2021-07-15 10:36:24
 * @Description:  This files is for 
 * 
 * @Modify History: 
 *  Ver   Who        Date         Changes
 * ----- ------     --------    --------------------------------------
 */
#include <string.h>
#include "parameters.h"
#include "ft_assert.h"
#include "timer_tacho_hw.h"
#include "timer_tacho.h"

void TimerGetDefConfig(u32 TimerID, TimerTachoConfig *pConfig)
{
    FT_ASSERTVOID((TimerID < TIMER_TACHO_NUM) && (NULL != pConfig));

    memset(pConfig, 0, sizeof(TimerTachoConfig));
    pConfig->Id = TimerID;
    pConfig->WorkMode  = TIMER_REG_TACHO_MODE_TIMER;
    pConfig->TimerMode = TIMER_REG_CNT_RESTART;
    pConfig->TimerBits = TIMER_REG_CNT_SERIES_32BIT;
    pConfig->CmpType = TIMER_REG_MODE_CYC;
    pConfig->ClearCnt  = FALSE;
    pConfig->ForceLoad = FALSE;
}

void TachoGetDefConfig(u32 TachoID, TimerTachoConfig *pConfig)
{
    FT_ASSERTVOID((TachoID < TIMER_TACHO_NUM) && (NULL != pConfig));

    memset(pConfig, 0, sizeof(TimerTachoConfig));
    pConfig->Id = TachoID;
    pConfig->WorkMode = TIMER_WORK_MODE_TACHO;
    pConfig->TimerMode = TIMER_REG_CNT_RESTART;
    pConfig->EdgeMode = TACHO_RISING_EDGE;
    pConfig->Debounce = 0;
    pConfig->ClearCnt  = FALSE;
    pConfig->ForceLoad = FALSE;    
}